home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / graphics / pbm / pbm_man.zoo / man1 / pbmmask.1 < prev    next >
Text File  |  1994-08-27  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. pbmmask(1)               USER COMMANDS                 pbmmask(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      pbmmask - create a mask bitmap from a regular bitmap
  10.  
  11. SYNOPSIS
  12.      pbmmask [-expand] [_✓p_✓b_✓m_✓f_✓i_✓l_✓e]
  13.  
  14. DESCRIPTION
  15.      Reads a portable bitmap as input.  Creates  a  corresponding
  16.      mask bitmap and writes it out.
  17.  
  18.      The color to be interpreted as  "background"  is  determined
  19.      automatically.  Regardless of which color is background, the
  20.      mask will be white where the background is and  black  where
  21.      the figure is.
  22.  
  23.      This lets you do a masked paste like this, for objects  with
  24.      a black background:
  25.          pbmmask obj > objmask
  26.          pbmpaste < dest -and objmask <x> <y> | pbmpaste -or obj <x> <y>
  27.      For objects with a white background, you can  either  invert
  28.      them or add a step:
  29.          pbmmask obj > objmask
  30.          pnminvert objmask | pbmpaste -and obj 0 0 > blackback
  31.          pbmpaste < dest -and objmask <x> <y> | pbmpaste -or blackback <x> <y>
  32.      Note that this three-step version  works  for  objects  with
  33.      black  backgrounds  too,  if you don't care about the wasted
  34.      time.
  35.  
  36.      You can also use masks with graymaps and pixmaps, using  the
  37.      _✓p_✓n_✓m_✓a_✓r_✓i_✓t_✓h tool.  For instance:
  38.          ppmtopgm obj.ppm | pgmtopbm -threshold | pbmmask > objmask.pbm
  39.          pnmarith -multiply dest.ppm objmask.pbm > t1.ppm
  40.          pnminvert objmask.pbm | pnmarith -multiply obj.ppm - > t2.ppm
  41.          pnmarith -add t1.ppm t2.ppm
  42.      An interesting variation on this is to pipe the mask through
  43.      the  _✓p_✓n_✓m_✓s_✓m_✓o_✓o_✓t_✓h script before using it.  This makes the boun-
  44.      dary between the two images less sharp.
  45.  
  46.      -expand
  47.           Expands the mask by one pixel out from the image.  This
  48.           is useful if you want a little white border around your
  49.           image.  (A better solution might be to turn the _✓p_✓b_✓m_✓l_✓i_✓f_✓e
  50.           tool into a general cellular automaton tool...)
  51.  
  52. SEE ALSO
  53.      pbmpaste(1), pnminvert(1), pbm(5), pnmarith(1), pnmsmooth(1)
  54.  
  55. AUTHOR
  56.      Copyright (C) 1988 by Jef Poskanzer.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sun Release 4.0    Last change: 08 August 1989                  1
  64.  
  65.  
  66.  
  67.